package com.cd.sendRequest.jpa.repo;

import com.cd.sendRequest.jpa.domain.HomeBanner;
import com.cd.sendRequest.jpa.domain.HomeMenu;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface HomeBannerRepo extends JpaRepository<HomeBanner, Long> {

    HomeBanner findByTypeAndOrder(String type, Integer order);

    @Query("SELECT MAX(h.order) FROM HomeBanner h WHERE h.type = :type")
    Integer findMaxOrderByType(@Param("type") String type);




}
